<template>
	<view>
		<view class="edgeInsetTop"></view>
		<view class="cu-list menu sm-border">
			<view class="cu-item arrow" @tap="$wanlshop.auth(`/pages/user/auth/validcode?event=resetpwd&mobile=${user.mobile}`)">
				<view class="content">
					<text>修改登录密码</text>
				</view>
			</view>
			<!-- <view class="cu-item arrow" @tap="noMobile" v-if="!user.mobile">
				<view class="content">
					<text>绑定手机号</text>
				</view>
			</view> -->
			<view class="cu-item arrow" @tap="noPay">
				<view class="content">
					<text>修改支付密码</text>
				</view>
			</view>
		</view>
		
		<!-- <view class="cu-list menu sm-border">
			<view class="cu-item arrow">
				<view class="content">
					<text>安全中心</text>
				</view>
			</view>
		</view> -->
		
		<view class="cu-list menu sm-border" @tap="noUser">
			<view class="cu-item arrow">
				<view class="content">
					<text>注销账户</text>
				</view>
			</view>
		</view>

		<uv-popup ref="popup" mode="center" @change="change">
			<view style="width: 600rpx;">
				<view class="">
					绑定手机号
				</view>
				<view class="">
					<view class="">
						手机号:
					</view>
					<uv-input placeholder="请输入内容" border="surround" clearable ></uv-input>	
				</view>
				<uv-button text="确认绑定"></uv-button>
			</view>
		</uv-popup>	
	</view>
</template>

<script>
	import { mapState} from 'vuex';
	export default {
		data() {
			return {
				user:{}
			}
		},
		onLoad() {
			this.user()
		},
		computed: {
			...mapState(['user'])
		},
		methods: {
			user(){
				uni.request({
					url: "/wanlshop/user/refresh",
					method: "POST",
					data: {
					},
					success: res => {
						console.log('-=-=-=res', res)
						this.user = res.data.userinfo
					}
				})
			},
			noPay(){
				this.$wanlshop.msg('暂无支付密码')
			},
			noUser(){
				this.$wanlshop.msg('暂不支持注销账户')
			},
			noMobile(){
				this.$refs.popup.open();
			}
		}
	}
</script>

<style>
	
</style>
